/*
 * $Id$
 *
 * Copyright 2008 HuangHuang. All rights reserved.
 */
package com.crm.model;

import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;
import java.util.Date;

/**
 * 用于统计分析的日志信息实体。
 *
 * @author <a href="mailto:huang0510@hotmail.com">HuangHuang</a>
 * @version $Id$
 * @hibernate.class table="SYSLOGS"
 */
public class SysLog implements Serializable {

    private String id;
    private Date logDate;
    private String userId;
    private String message;
    private String action;
    private String target;

    public static final String ACT_C = "create";
    public static final String ACT_R = "read";
    public static final String ACT_U = "update";
    public static final String ACT_D = "delete";

    public static final String T_CUST = "customer";
    public static final String T_CONT = "contact";
    public static final String T_PROC = "process";

    public SysLog() {
    }

    public SysLog(String userId, String action, String target, String message) {
        this.userId = userId;
        this.action = action;
        this.target = target;
        this.message = message;
        this.logDate = new Date();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

   public Date getLogDate() {
        return logDate;
    }

    public void setLogDate(Date logDate) {
        this.logDate = logDate;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public String toString() {
        return new ToStringBuilder(this).
                append("id", id).
                append("logDate", logDate).
                append("userId", userId).
                append("message", message).
                append("action", action).
                append("target", target).
                toString();
    }

}
